import request from '/@/utils/request';

/**
 * （不建议写成 request.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 * 登录api接口集合
 * @method /getNews 所有活动列表
 * @method /suggestion 所有活动列表
 * @method /appeal 申诉
 * @method /getMaterial 所有活动列表
 * @method /updateInfo 所有活动列表
 * @method /userInfo 所有活动列表
 * @method /myQuestion 获取我的问题
 * @method /subQuestion 获取我的问题
 * @method /msgList 获取消息列表
 * @method /msgRead 已读消息
 * @method /myMsg 获取未读消息数
 */
export function useIndexApi() {
	return {
		getNews: (data: object) => {
			return request({
				url: '/news',
				method: 'post',
				data,
			});
		},
		suggestion: (data: object) => {
			return request({
				url: '/suggestion',
				method: 'post',
				data,
			});
		},
		appeal: (data: object) => {
			return request({
				url: '/appeal',
				method: 'post',
				data,
			});
		},
		getMaterial: (data: object) => {
			return request({
				url: '/file-list',
				method: 'post',
				data,
			});
		},
		userInfo: (data: object) => {
			return request({
				url: '/user-info',
				method: 'post',
				data,
			});
		},
		updateInfo: (data: object) => {
			return request({
				url: '/update-info',
				method: 'post',
				data,
			});
		},
		myQuestion: (data: object) => {
			return request({
				url: '/my-question',
				method: 'post',
				data,
			});
		},
		subQuestion: (data: object) => {
			return request({
				url: '/sub-question',
				method: 'post',
				data,
			});
		},
		appendQuestion: (data: object) => {
			return request({
				url: '/append-question',
				method: 'post',
				data,
			});
		},
		endQuestion: (data: object) => {
			return request({
				url: '/end-question',
				method: 'post',
				data,
			});
		},
		msgList: (data: object) => {
			return request({
				url: '/msg-list',
				method: 'post',
				data,
			});
		},
		msgRead: (data: object) => {
			return request({
				url: '/msg-read',
				method: 'post',
				data,
			});
		},
		myMsg: (data: object) => {
			return request({
				url: 'my-msg',
				method: 'post',
				data,
			});
		},
	};
}
